//
//  TCallKeyborad.m
//  timelyRain
//
//  Created by Jiafei Wei on 16/9/26.
//  Copyright © 2016年 Jiafei Wei. All rights reserved.
//

#import "TCallKeyborad.h"
#import "MBTPre.h"

@implementation TCallKeyborad

+ (instancetype)headerView
{
    TCallKeyborad *footer = [[[NSBundle mainBundle] loadNibNamed:@"TCallKeyborad" owner:nil options:nil] lastObject];
    //footer.frame =CGRectMake(0, SCREEN_H-footer.frame.size.height-100, SCREEN_W, footer.frame.size.height);
    return footer;
}

- (void)awakeFromNib//走了两次
{
      for (UIView *subview in self.subviews)
    {
        for (UIView *su in subview.subviews)
        {
            if ([su isKindOfClass:[UIButton class]]) {
                UIButton *b =(UIButton *)su;
                [b addTarget:self action:@selector(click:)
            forControlEvents:UIControlEventTouchUpInside];
            }
        }
    }
}

-(void)click:(UIButton *)b{
    if ([self.delegate respondsToSelector:@selector(contactkeyBoard:)]) {
        [self.delegate contactkeyBoard:b];
    }
}
@end
